package com.maduar.demo.designPattern;

/**
 * Description:
 *
 * @author danny.pang danny.pang@ebizprise.com
 * @date 2020-03-09 00:11
 */
public class OperationDemo {

    public static void main(String[] args) {

        int a = 2;
        int b = 1;

        Operation add = OperationFactory.createOperate(OperationEnum.ADD);
        int addResult = add.getResult(a, b);
        System.out.println("addResult: " + addResult);

        Operation sub = OperationFactory.createOperate(OperationEnum.SUB);
        int subResult = sub.getResult(a, b);
        System.out.println("subResult: " + subResult);

    }
}
